//
//  feynman.c
//  complexidade
//  https://br.spoj.pl/problems/FEYNMAN
//  Created by Bruno Dias on 17/04/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#include <stdio.h>
int main() {
	int n, eq;
	scanf("%d",&n);
	while( n!= 0) {
		eq = 0;
		if (n != 0 && n <= 100){
			for (n > 0; n == n; n--) {
				eq = (n*n) + eq;	
				}
		} else 
		break;
		printf("%d\n",eq);
		scanf("%d",&n);	
	}
	return 0;
}


     		
	
	
	

	
	
